from typing import List


class Solution:
    def maxSubArray(self, nums: List[int]) -> int:
        max_sum = -float('inf')
        s = 0
        for i in nums:
            s+=i
            print(s)
            if s > max_sum:
                print("nihao")
                max_sum = s
                print(max_sum)
            if s < 0:
                s = 0

        return max_sum

if __name__ == '__main__':
    nums = [-1]

    soluton = Solution()
    val = soluton.maxSubArray(nums)
    print(val)

